package com.byb.server.service.mapper;

import com.byb.server.domain.*;
import com.byb.server.service.dto.WcInsuranceCategoryDTO;

import org.mapstruct.*;

/**
 * Mapper for the entity WcInsuranceCategory and its DTO WcInsuranceCategoryDTO.
 */
@Mapper(componentModel = "spring", uses = {WcInsuranceTypeMapper.class, })
public interface WcInsuranceCategoryMapper extends EntityMapper <WcInsuranceCategoryDTO, WcInsuranceCategory> {

    @Mapping(source = "wcInsuranceType.id", target = "wcInsuranceTypeId")
    @Mapping(source = "wcInsuranceType.name", target = "wcInsuranceTypeName")
    WcInsuranceCategoryDTO toDto(WcInsuranceCategory wcInsuranceCategory); 

    @Mapping(source = "wcInsuranceTypeId", target = "wcInsuranceType")
    WcInsuranceCategory toEntity(WcInsuranceCategoryDTO wcInsuranceCategoryDTO); 
    default WcInsuranceCategory fromId(Long id) {
        if (id == null) {
            return null;
        }
        WcInsuranceCategory wcInsuranceCategory = new WcInsuranceCategory();
        wcInsuranceCategory.setId(id);
        return wcInsuranceCategory;
    }
}
